package org.bioversityinternational.mgbms.model.domain;

// Generated 13 oct. 2011 12:11:05 by Hibernate Tools 3.4.0.CR1

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * AssOrderAccession generated by hbm2java
 */
@Entity
@Table(name = "AssOrderAccession", schema = "dbo", catalog = "imgbms")
public class AssOrderAccession implements java.io.Serializable {

	private AssOrderAccessionId id;
	private Accession accession;
	private Order order;
	private MaterialType materialType;

	public AssOrderAccession() {
	}

	public AssOrderAccession(AssOrderAccessionId id, Accession accession,
			Order order, MaterialType materialType) {
		this.id = id;
		this.accession = accession;
		this.order = order;
		this.materialType = materialType;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "orderId", column = @Column(name = "orderId", nullable = false)),
			@AttributeOverride(name = "accessionId", column = @Column(name = "accessionId", nullable = false)),
			@AttributeOverride(name = "materialTypeId", column = @Column(name = "materialTypeId", nullable = false)) })
	public AssOrderAccessionId getId() {
		return this.id;
	}

	public void setId(AssOrderAccessionId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "accessionId", nullable = false, insertable = false, updatable = false)
	public Accession getAccession() {
		return this.accession;
	}

	public void setAccession(Accession accession) {
		this.accession = accession;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "orderId", nullable = false, insertable = false, updatable = false)
	public Order getOrder() {
		return this.order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "materialTypeId", nullable = false, insertable = false, updatable = false)
	public MaterialType getMaterialType() {
		return this.materialType;
	}

	public void setMaterialType(MaterialType materialType) {
		this.materialType = materialType;
	}

}
